﻿@model IEnumerable<Guan.CMS.Web.ViewModels.ProductCategory.ProductCategoryTree>
@{
    Layout = null;
}
@if (Model == null || !Model.Any())
{
    <li>
        <a href="@Url.Action("Index","Products")">产品介绍</a>
    </li>
}
else
{
    <li class="has-dd">
        <a href="@Url.Action("Index", "Products")">产品介绍</a>
        <ul>
            @foreach (var top in Model)
            {
                if (top.Children != null && top.Children.Any())
                {
                    <li class="has-dd">
                        @Html.ActionLink(top.Name, "Index", new {category = top.Id}, new {title = "产品分类：" + top.Name})
                        <ul>
                            @foreach (var sub in top.Children)
                            {
                                <li>@Html.ActionLink(sub.Name, "Index", new {category = sub.Id})</li>
                            }
                        </ul>
                    </li>
                }
                else
                {
                    <li>@Html.ActionLink(top.Name, "Index", new { category = top.Id }, new { title = "产品分类：" + top.Name })</li>
                }
            }
        </ul>
    </li>
}